<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">

<head>
    <title th:text="${pageTitle}"></title>
    <div data-th-replace="layout/head-top"></div>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInLeft">
        <div data-th-replace="common/functionDepict"></div>
        <div>
            <div class="row">
                <div class="pt10">
                    <div class="col-sm-9">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <h5>填写基本信息</h5>
                            </div>
                            <div class="ibox-content clearfix pt10">
                                <input type="hidden" id="_subjectIds" th:value="${teacher['subjectIds']}"/>
                                <form class="form-horizontal m-t" id="teacherForm">
                                    <div class="form-horizontal">
                                        <input name="id" th:value="${teacher['id']}" type="hidden"/>
                                        <input type="hidden" id="qaTypeId" th:value="${teacher['qaTypeId']}"/>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 讲师名称</label>
                                            <div class="col-sm-8">
                                                <input class="validate-data form-control" type="text" name="teacherName" th:value="${teacher['teacherName']}" />
                                                <span class="help-block m-b-none c-999">请填写真实姓名，且需要与身份证姓名/开户行姓名保持一致</span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <input type="hidden" name="subjectIds" id="subjectIds" th:value="${teacher['subjectIds']}"/>
                                            <label class="col-sm-2 control-label"><i class="c-red">*</i> 选择专业</label>
                                            <div class="col-sm-8">
                                                <div id="teacher-subject-box"></div>
                                                <div id="teacher-subject-context"></div>
                                                <span class="help-block m-b-none c-999">选择所属专业或去新建</span>
                                            </div>
                                            <div class="col-sm-2 mt10"><a href="javascript:;" onclick="getRedirectMenu(baseloaction+'/admin/manage/subject/toSubjectList')"><i class="fa fa-plus"></i> 新建专业</a></div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right">对应后台登录账号</label>
                                            <div class="col-sm-8">
                                                <p><button id="selectSysUser" class="btn btn-primary " type="button"><i class="fa fa-plus"></i> 选择账号</button></p>
                                                <div id="user-div" class="well m-t mt10 no-padding">
                                                    <ul class="list-group">
                                                        <li class="list-group-item">
                                                            <input id="sysUserId" type="hidden" name="sysUserId" th:value="${teacher['sysUserId']}"/>
                                                            <span class="pull-right">
                                                                <a href="javascript:void(0);" id="reomve-sys-user" title="移除" class="c-999 fs14"><i class="fa fa-remove" th:classappend="${teacher['sysUser']}==null?hide:''"></i></a>
                                                            </span>
                                                            <span class="fs14" id="userName">
                                                                <i class="fa fa-user" th:classappend="${teacher['sysUser']}==null?hide:''"></i>
                                                                <span th:text="${teacher['sysUser']}!=null ?${teacher['sysUser']['ralName']}+'/'+${teacher['sysUser']['username']}:'如果有需要关联管理用户可以选择关联用户'"></span>
                                                            </span>
                                                        </li>
                                                    </ul>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 讲师头像</label>
                                            <div class="col-sm-8">
                                                <p>
                                                    <button class="btn btn-primary " id="teacherImageBtn" type="button"><i class="fa fa-image"></i>&nbsp;选择讲师头像</button>
                                                    <span>
                                                        <small class="fs12 c-red">
                                                             &nbsp;&nbsp;&nbsp;*&nbsp;建议最大尺寸(宽*高 px)：380*380&nbsp;&nbsp;或者比例:&nbsp;1:1
                                                        </small>
                                                    </span>
                                                </p>
                                                <div class="clearfix" id="coverImage">
                                                    <div class="file-box">
                                                        <div class="file">
                                                            <span class="corner" title="删除" id="remove-image"><i class="fa fa-remove"></i></span>
                                                            <div class="image">
                                                                <input type="hidden" id="imageJson" name="imageJson" th:value="${teacher['imageJson']}"/>
                                                                <img alt="讲师头像" id="teacher-image" class="img-responsive"th:src="!${#maps.isEmpty(teacher['imageMap'])} ? ${teacher['imageMap']['pcUrlMap']['large']} : @{{path}/admin/v3/img/default/default-pic.jpg?v={v}(path=${staticPath},v=${v})}"/>
                                                            </div>
                                                            <div class="file-name">
                                                                <p id="file-names" th:text="!${#maps.isEmpty(teacher['imageMap'])} and ${teacher['imageMap']['fileName']}!=null ? ${teacher['imageMap']['fileName']}:'文件名'"></p>
                                                                <small id="create-time" th:text="!${#maps.isEmpty(teacher['imageMap'])} and ${teacher['imageMap']['createTime']}!=null ? ${teacher['imageMap']['createTime']}:'上传时间'"></small>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right"> <i class="c-red">*</i> 讲师详情介绍</label>
                                            <div class="col-sm-8">
                                                <textarea id="teacher-depict" name="depict" class="form-control validate-data" style="height: 120px;resize: none;" th:text="${teacher['depict']}"></textarea>
                                                <span class="help-block m-b-none c-999">请填写讲师详情介绍</span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 讲师性质</label>
                                            <div class="col-sm-8">
                                                <div class="radio i-checks">
                                                    <label>
                                                        <input type="radio" th:checked="${teacher['teacherType']}==1 or ${teacher['teacherType']}==null"  name="teacherType" value="1" /> <i></i> <strong>平台自有</strong> - 机构自有员工
                                                    </label>
                                                    <label>
                                                        <input type="radio" th:checked="${teacher['teacherType']}==2" name="teacherType" value="2" /> <i></i> <strong>入驻讲师</strong> - 由普通用户申请而成为的老师
                                                    </label>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 是否问答专家</label>
                                            <div class="col-sm-8">
                                                <div class="radio i-checks">
                                                    <label>
                                                        <input type="radio" id="isQuestion-1" th:checked="${teacher['isQuestion']}==null or ${teacher['isQuestion']}==0" name="isQuestion" value="0"/> <i></i> <strong>否</strong>
                                                    </label>
                                                    <label>
                                                        <input type="radio" id="isQuestion-2" th:checked="${teacher['isQuestion']}==1" name="isQuestion" value="1" /> <i></i> <strong>是</strong>
                                                    </label>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right"><i class="c-red">*</i>  讲师身份</label>
                                            <div class="col-sm-8">
                                                <div class="checkboxi-checks">
                                                    <label><input  id="teacher_identity" name="teacherIdentity_1" class="i-checks click" type="checkbox" th:checked="${teacher['teacherIdentity']}!=null and ${#strings.contains(teacher['teacherIdentity'],'1')}" value="1"/> 讲师</label>
                                                    <label><input id="" name="teacherIdentity_1" class="i-checks click" type="checkbox" th:checked="${teacher['teacherIdentity']}!=null and ${#strings.contains(teacher['teacherIdentity'],'2')}" value="2"/> 班主任</label>
                                                </div>
                                                <input type="hidden" id="teacherIdentity" value="" name="teacherIdentity"/>
                                                <input id="teacherIdentity1" type="hidden" value=""/>
                                                <input id="teacherIdentity2" type="hidden" value=""/>
                                            </div>
                                        </div>
                                        <div id="question-div" th:style="${teacher['isQuestion']}==null or ${teacher['isQuestion']}==0? 'display: none':''">
                                            <div class="hr-line-dashed"></div>
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 提问费用</label>
                                                <div class="col-sm-8">
                                                    <div class="input-group m-b">
                                                        <span class="input-group-addon">￥</span>
                                                        <input class="validate-data form-control" type="text" name="questionFee" th:value="${teacher['questionFee']}!=null and ${teacher['questionFee']}>0 ?${#numbers.formatInteger(teacher['questionFee'],1,'POINT')}:'0'"/>
                                                    </div>
                                                    <span class="help-block m-b-none c-999">学员向此讲师提问时，需要付的钱数</span>
                                                </div>
                                            </div>
                                            <div class="hr-line-dashed"></div>
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 分成比例</label>
                                                <div class="col-sm-8">
                                                    <div class="input-group m-b">
                                                        <span class="input-group-addon"><i class="fa fa-balance-scale"></i></span>
                                                        <input class="validate-data form-control" type="number"  placeholder="请输入分成比例"  name="separateInto" th:value="${teacher['separateInto']}==null? '0':${teacher['separateInto']}" />
                                                        <span class="input-group-addon">%</span>
                                                    </div>
                                                    <span class="help-block m-b-none c-999">学员付费提问时，讲师按此比例获取的分成,分成比例只能为正整数</span>
                                                </div>
                                            </div>
                                            <div class="hr-line-dashed"></div>
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label"><i class="c-red">*</i> 负责问答分类</label>
                                                <div class="col-sm-8">
                                                    <div class="clearfix">
                                                        <div class="input-group">
                                                            <select class="form-control mb10 custom-select" data-placeholder="选择问答分类..." name="qaTypeId" style="width: 300px;" tabindex="1">
                                                                <option value="0">选择问答分类</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                    <span class="help-block m-b-none c-999">选择问答分类或去新建分类</span>
                                                </div>
                                                <div class="col-sm-2 mt10"><a href="javascript:;" onclick="getRedirectMenu(baseloaction + '/admin/qa/qatype/initAdd')"><i class="fa fa-plus"></i> 新建问答分类</a></div>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 排序</label>
                                            <div class="col-sm-8">
                                                <div class="input-group m-b"><span class="input-group-addon"><i class="fa fa-sort-numeric-asc"></i></span>
                                                    <input placeholder="排序数需为整数" class="validate-data form-control" th:value="${teacher['sort']}==null?'0':${teacher['sort']}" type="text" name="sort" onkeyup="this.value=this.value.replace(/\D/g,'')"/>
                                                </div>
                                                <span>
                                                    <small class="fs12 c-red">说明：数字越高，排位越前</small>
                                                </span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <div class="col-sm-8 col-sm-offset-2">
                                                <button id="save-back" class="btn btn-primary ml10" type="button">保存，返回</button>
                                                <button id="save-continue" class="btn btn-danger" type="button">保存，继续创建</button>
                                                <button id="cancel" class="btn btn-white ml10" type="button">取消</button>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                    <div data-th-replace="common/importantNotes"></div>
                </div>
            </div>
        </div>
    </div>
    <div data-th-replace="layout/head-footer"></div>
    <script type="text/javascript" th:src="@{{path}/admin/business/upload/common-webuploader.js?v={v}(path=${staticPath},v=${v})}"></script>
    <script type="text/javascript" th:src="@{{path}/admin/business/manage/teacher/save-teacher.js?v={v}(path=${staticPath},v=${v})}"></script>
    <script type="text/javascript" th:src="@{{path}/admin/business/manage/user/common-select-user-list.js?v={v}(path=${staticPath},v=${v})}"></script>
</body>

</html>
